package com.wyh.apitest.source

import com.wyh.apitest.source.CustomSource.MySensorSource
import org.apache.flink.streaming.api.scala._

object SourceCustom {
  def main(args: Array[String]): Unit = {

    val streamEnv = StreamExecutionEnvironment.getExecutionEnvironment
    //将并行度设置为1，先以这个方式按照顺序读进来
    streamEnv.setParallelism(1)

    //自定义Source  MySensorSource
    val stream = streamEnv.addSource(new MySensorSource())
    stream.print()

    streamEnv.execute("自定义Source")

  }

}